﻿
namespace Wicresoft.Platform.Processes.Mobile.Web.Services
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.ComponentModel.DataAnnotations;
    using System.Data;
    using System.Linq;
    using System.ServiceModel.DomainServices.EntityFramework;
    using System.ServiceModel.DomainServices.Hosting;
    using System.ServiceModel.DomainServices.Server;
    using Wicresoft.Platform.Workflows.Mobile;


    // Implements application logic using the MobileEntities context.
    // TODO: Add your application logic to these methods or in additional methods.
    // TODO: Wire up authentication (Windows/ASP.NET Forms) and uncomment the following to disable anonymous access
    // Also consider adding roles to restrict access as appropriate.
    // [RequiresAuthentication]
    [EnableClientAccess()]
    public class DomainService3 : LinqToEntitiesDomainService<MobileEntities>
    {

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'Wicresoft_Platform_Processes_Mobile' query.
        public IQueryable<Wicresoft_Platform_Processes_Mobile> GetWicresoft_Platform_Processes_Mobile()
        {
            return this.ObjectContext.Wicresoft_Platform_Processes_Mobile;
        }

        public void InsertWicresoft_Platform_Processes_Mobile(Wicresoft_Platform_Processes_Mobile wicresoft_Platform_Processes_Mobile)
        {
            if ((wicresoft_Platform_Processes_Mobile.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(wicresoft_Platform_Processes_Mobile, EntityState.Added);
            }
            else
            {
                this.ObjectContext.Wicresoft_Platform_Processes_Mobile.AddObject(wicresoft_Platform_Processes_Mobile);
            }
        }

        public void UpdateWicresoft_Platform_Processes_Mobile(Wicresoft_Platform_Processes_Mobile currentWicresoft_Platform_Processes_Mobile)
        {
            this.ObjectContext.Wicresoft_Platform_Processes_Mobile.AttachAsModified(currentWicresoft_Platform_Processes_Mobile, this.ChangeSet.GetOriginal(currentWicresoft_Platform_Processes_Mobile));
        }

        public void DeleteWicresoft_Platform_Processes_Mobile(Wicresoft_Platform_Processes_Mobile wicresoft_Platform_Processes_Mobile)
        {
            if ((wicresoft_Platform_Processes_Mobile.EntityState == EntityState.Detached))
            {
                this.ObjectContext.Wicresoft_Platform_Processes_Mobile.Attach(wicresoft_Platform_Processes_Mobile);
            }
            this.ObjectContext.Wicresoft_Platform_Processes_Mobile.DeleteObject(wicresoft_Platform_Processes_Mobile);
        }
    }
}


